home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / python-apt / text / apt / progress.txt < prev   
Encoding:
Text File  |  2009-03-30  |  3.8 KB  |  190 lines

  1.  
  2. ``apt.progress`` --- Classes for progress reporting
  3. ***************************************************
  4.  
  5. progress reporting classes.
  6.  
  7. This module provides classes for progress reporting. They can be used
  8. with e.g., for reporting progress on the cache opening process, the
  9. cache update progress, or the package install progress.
  10.  
  11. Warning: This class is currently under re-organisation. Therefore, the API
  12.   may change soon. The old names will still be kept until it is safe
  13.   to remove them.
  14.  
  15.  
  16. Classes without output
  17. ======================
  18.  
  19. class apt.progress.FetchProgress
  20.  
  21.    Report the download/fetching progress.
  22.  
  23.    Subclass this class to implement fetch progress reporting
  24.  
  25.    mediaChange(medium, drive)
  26.  
  27.       react to media change events.
  28.  
  29.    pulse()
  30.  
  31.       Called periodically to update the user interface.
  32.  
  33.       Return True to continue or False to cancel.
  34.  
  35.    start()
  36.  
  37.       Called when the fetching starts.
  38.  
  39.    stop()
  40.  
  41.       Called when all files have been fetched.
  42.  
  43.    updateStatus(uri, descr, shortDescr, status)
  44.  
  45.       Called when the status of an item changes.
  46.  
  47.       This happens eg. when the downloads fails or is completed.
  48.  
  49. class apt.progress.OpProgress
  50.  
  51.    Abstract class to implement reporting on cache opening.
  52.  
  53.    Subclass this class to implement simple Operation progress
  54.    reporting.
  55.  
  56.    done()
  57.  
  58.       Called once an operation has been completed.
  59.  
  60.    update(percent)
  61.  
  62.       Called periodically to update the user interface.
  63.  
  64. class apt.progress.CdromProgress
  65.  
  66.    Report the cdrom add progress.
  67.  
  68.    Subclass this class to implement cdrom add progress reporting.
  69.  
  70.    askCdromName()
  71.  
  72.       Called to ask for the name of the cdrom.
  73.  
  74.    changeCdrom()
  75.  
  76.       Called to ask for the cdrom to be changed.
  77.  
  78.    update(text, step)
  79.  
  80.       Called periodically to update the user interface.
  81.  
  82. class apt.progress.DumbInstallProgress
  83.  
  84.    Report the install progress.
  85.  
  86.    Subclass this class to implement install progress reporting.
  87.  
  88.    finishUpdate()
  89.  
  90.       Called when update has finished.
  91.  
  92.    run(pm)
  93.  
  94.       Start installation.
  95.  
  96.    startUpdate()
  97.  
  98.       Start update.
  99.  
  100.    updateInterface()
  101.  
  102.       Called periodically to update the user interface
  103.  
  104.  
  105. Implementing classes for text output
  106. ====================================
  107.  
  108. class apt.progress.TextFetchProgress
  109.  
  110.    Ready to use progress object for terminal windows
  111.  
  112.    mediaChange(medium, drive)
  113.  
  114.       react to media change events.
  115.  
  116.    pulse()
  117.  
  118.       Called periodically to update the user interface.
  119.  
  120.       Return True to continue or False to cancel.
  121.  
  122.    stop()
  123.  
  124.       Called when all files have been fetched.
  125.  
  126.    updateStatus(uri, descr, shortDescr, status)
  127.  
  128.       Called when the status of an item changes.
  129.  
  130.       This happens eg. when the downloads fails or is completed.
  131.  
  132. class apt.progress.OpTextProgress
  133.  
  134.    A simple text based cache open reporting class.
  135.  
  136.    done()
  137.  
  138.       Called once an operation has been completed.
  139.  
  140.    update(percent)
  141.  
  142.       Called periodically to update the user interface.
  143.  
  144. class apt.progress.InstallProgress
  145.  
  146.    An InstallProgress that is pretty useful.
  147.  
  148.    It supports the attributes 'percent' 'status' and callbacks for the
  149.    dpkg errors and conffiles and status changes.
  150.  
  151.    conffile(current, new)
  152.  
  153.       Called when a conffile question from dpkg is detected.
  154.  
  155.    error(pkg, errormsg)
  156.  
  157.       Called when a error is detected during the install.
  158.  
  159.    fork()
  160.  
  161.       Fork.
  162.  
  163.    run(pm)
  164.  
  165.       Start installing.
  166.  
  167.    statusChange(pkg, percent, status)
  168.  
  169.       Called when the status changed.
  170.  
  171.    updateInterface()
  172.  
  173.       Called periodically to update the interface.
  174.  
  175.    waitChild()
  176.  
  177.       Wait for child progress to exit.
  178.  
  179. class apt.progress.DpkgInstallProgress
  180.  
  181.    Progress handler for a local Debian package installation.
  182.  
  183.    run(debfile)
  184.  
  185.       Start installing the given Debian package.
  186.  
  187.    updateInterface()
  188.  
  189.       Process status messages from dpkg.
  190.